<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
<div class="easyui-layout" fit="true">
  <div region="center" style="padding:0px;border:0px">
  <t:datagrid name="dictCategoryList" checkbox="false" fitColumns="true" title="实验类别字典" actionUrl="trainItemController.do?select" idField="id" fit="true" queryMode="group">
   <t:dgCol title="主键"  field="id"  hidden="true"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="创建日期"  field="createDate" formatter="yyyy-MM-dd" hidden="true"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="培训名称"  field="trainningName"   query="true" queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="培训工种"  field="teachItem.itemName"   query="true" queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="开始报名日期"  field="startEnterDate" formatter="yyyy-MM-dd" queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="结束报名日期"  field="endEnterDate" formatter="yyyy-MM-dd"   queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="报名人数"  field="enterCount" hidden="true" queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="报名人数"  field="maxEnterCount" hidden="true" queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="报名人数"  field="peopleCount" formatterjs="getPeopleCount" hidden="false" queryMode="single"  width="120"></t:dgCol>   
   </t:datagrid>
  </div>
 </div>
 <script type="text/javascript">
 
function getPeopleCount(v,rec){
	return rec['enterCount']+"/"+rec['maxEnterCount'];
}

function getIsPub(v,rec){
	if(v==0){
		return '未发布';
	}else{
		return '已发布';
	}
}

function pubItem(id){
	$.dialog.confirm('确定要发布培训项目吗？',function(r){
		if(r){
			$.ajax({
				url:"trainItemController.do?pubItem&id="+id,
				success:function(d){
					d = $.parseJSON(d);
					tip(d.msg)
					if(d.success){
						reloadTable();
					}
				}
			});
		}
	});
}

 </script>